package com.yanqu.road.server.cmd.activity.busyfarming;

import com.yanqu.road.pb.activity.BusyFarmingProto;
import com.yanqu.road.server.cmd.CrossCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.logic.MessageHelper;
import com.yanqu.road.server.manager.busyfarming.CrossBusyFarmingMgr;
import com.yanqu.road.utils.YanQuMessageUtils;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.server.protocol.Protocol;

@Cmd(code = Protocol.C_BUSY_FARMING_FRIEND_HOME_LIST,desc = "亲家果园")
public class CrossBusyFarmingFriendHomeListCmd extends CrossCommand {

    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        return true;
    }

    @Override
    public void execute(YanQuMessage packet) throws Exception {

        BusyFarmingProto.BusyFarmingFriendHomeListCrossReqMsg reqMsg = BusyFarmingProto.BusyFarmingFriendHomeListCrossReqMsg.parseFrom(packet.getBytes());
        int type = reqMsg.getType();

        MessageHelper.sendPacket(serverId, packet.getPlayerId(), YanQuMessageUtils.buildMessage(Protocol.U_BUSY_FARMING_FRIEND_HOME_LIST,
                CrossBusyFarmingMgr.friendHomeList(serverId, packet.getPlayerId(), reqMsg.getActivityId(), type, reqMsg.getUserList(), reqMsg.getCanWatering(), reqMsg.getWateringLimit())));
    }

    @Override
    public void sendData() {

    }
}
